package com.bwie.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 国兴越
 * @version 1.0
 * Create by
 */
@Data
@Document(indexName = "tb_loan",shards = 1,replicas = 1)
public class EsLoan implements Serializable {

    @Id
    private Integer id;
    @Field(type = FieldType.Integer)
    private Integer rid;
    @Field(type = FieldType.Integer)
    private Integer pid;
    @Field(type = FieldType.Integer)
    private Integer mid;
    @Field(type = FieldType.Integer)
    private Integer tid;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String name;
    @Field(type = FieldType.Integer)
    private Integer money;
    @Field(type = FieldType.Integer)
    private Integer timeday;
    @Field(type = FieldType.Keyword)
    private String url;
    @Field(type = FieldType.Integer)
    private Integer status;
    @Field(type = FieldType.Integer)
    private Integer role;

    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;


    @Field(type = FieldType.Keyword)
    private String numperiods;

    @Field(type = FieldType.Keyword)
    private String repay;

    @Field(type = FieldType.Keyword)
    private String loantime;

    @Field(type = FieldType.Keyword)
    private String type;




}
